package com.yecheng.yeaiagent.tools;

import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ToolRegistration {

    @Value("${search-api.api-key}")
    private String serchApiKey;

    @Bean
    public ToolCallback[] allTools(){
        FileOperationsTools fileOperationsTools = new FileOperationsTools();
        WebSearchTools webSearchTools = new WebSearchTools(serchApiKey);
        PDFGenerationTools pdfGenerationTools = new PDFGenerationTools();
        WebScrapingTools webScrapingTools = new WebScrapingTools();
        ResourceDownloadTools resourceDownloadTools = new ResourceDownloadTools();
        TerminalOperationTools terminalOperationTools = new TerminalOperationTools();
        TerminateTools terminateTools = new TerminateTools();
        return ToolCallbacks.from(fileOperationsTools,webSearchTools,pdfGenerationTools,webScrapingTools,resourceDownloadTools,terminalOperationTools,terminateTools);
    }
}
